#pragma once

#include <fstream>
using std::ifstream;
#include <stdexcept>
using std::exception;
using std::runtime_error;

#include "Common.h"

namespace davrenderer { class ShaderObject; }
using namespace davrenderer;

/* * * * * * * * * *
 * ShaderObject
 * Author:	David Ogle
 * Date:	04/04/2012
 * Encapsualtion of a single shader object, e.g.
 * a single Vertex, Fragment or Geometry program.
 * * * * * * * * * */
class davrenderer::ShaderObject 
{
friend class Shader;
private:

	ShaderObject(ShaderObject &copy) { };	// Hide the copy constructor

protected:

	GLint	id;
	GLenum	type;

	void createShaderFromString(string shader, GLenum type);

public:

	ShaderObject(string s, GLenum type, bool isFilename = true);
	ShaderObject(ifstream &s, GLenum type);
	~ShaderObject(void);

	GLint	getId()		{ return id; }
	GLenum	getType()	{ return type; }

};